

	var login = new Vue({
	  el: '#login',
	  data: {
        verificationBot: '发送验证码',
        countDownTime: 60,
        VerificationInd: '',
        controller: {
            alertText:''
        },
	    message: {
            phone: '',
            verification: ''
        },


	  },
       methods: {
        verificationAjaxFun: function() {
            if (checkPhone(this.message.phone) ) {

                if (!(this.message.verification.length < 6)) {
                    if (this.message.verification == this.VerificationInd) {
                        loginObj.setLogoinInfo(this.message.phone)

                        window.location.href = 'index.html';

                    }else{
                        this.AlertConFun('验证码错误!') 

                    }
                }else{
                     this.AlertConFun('请正确填写验证码') 
                }

            }else{
               this.AlertConFun('请正确填写手机号码') 
            }


        },
        GetVerificationAjaxFun: function() {

            if (this.countDownTime == 60) {
                if (checkPhone(this.message.phone)) {
                    this.countDown();


                    axios.get(severUrl+'sendPhone?phone='+login._data.message.phone).then(function(response) {

                       if (response.data.code == 1) {
                            login._data.VerificationInd = response.data.data.verificationCode;
                            login._data.isWrite = response.data.data.isExist;
                        }

                    });

                }else{
                    console.log(false)
                    this.AlertConFun('请正确填写手机号码')


                }
            }

            
            
        },
        countDown:function() {
            if (this.countDownTime != 0) {
                this.countDownTime --;
                this.verificationBot = this.countDownTime +'秒';
                setTimeout(function() {
                    this.login.countDown();
                },1000)

            }else{
                this.countDownTime = 60;
                this.verificationBot = '发送验证码';

            }
                        
        },
        AlertConFun: function(string) {
            this.controller.alertText = string;
            setTimeout(function(argument) {
                this.login._data.controller.alertText = false;
            },1500)

        }
      },
       
	})


